package com.prime.tutorial.moviestore.view.reports;

import com.prime.tutorial.moviestore.domain.Location;
import com.prime.tutorial.moviestore.service.reports.ReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;
/**
 * Provides the view level of the addressesWithDevices report.
 * @author vasylja
 */
@Component("addressesWithDevices")
@Scope("request")
public class AddressesWithDevicesImpl {
    private ReportsService reportsService;
    private List<Location> listAddressesWithDevices;

    @Autowired
    public AddressesWithDevicesImpl(ReportsService reportsService) {
        this.reportsService = reportsService;
        setListAddressesWithDevices(this.reportsService.getAddressesWithDevicesReport());
    }


    public List<Location> getListAddressesWithDevices() {
        return listAddressesWithDevices;
    }

    private void setListAddressesWithDevices(List<Location> listAddressesWithDevices) {
        this.listAddressesWithDevices = listAddressesWithDevices;
    }
}
